import 'package:flutter/foundation.dart';

class Item {
    final String id;
    final String body;
    
    Item({
        @required this.id,
        @required this.body
    });
    
    Item copyWith({String id, String body}) {
        return Item(
            id: id ?? this.id,
            body: body ?? this.body
        );
    }
    
}

class AppState {
    
    final List<Item> items;
    
    AppState({
        @required this.items
    });
    
    //命名的构造函数
    AppState.initState() : items = List.unmodifiable(<Item>[]);
}